<?php

abstract class McCube_Html_Abstact{

    protected $_attrs = array();

    /** */
    public function buildAttrs($attrs=array()){
        if(!$attrs)
            $attrs = $this->_attrs;

        $echo = '';
        foreach($attrs as $attr => $value)
            $echo .= ' '.$attr.'="'.$value.'"';

        return $echo;
    }

    /** */
    public function getAttr($name){
        return $this->_attrs[$name];
    }

    /** */
    public function setAttr($name, $value){
        $this->_attrs[$name] = $value;
        return $this;
    }

    /** */
    public function setAttrs($attrs){
        $this->_attrs += $attrs;
        return $this;
    }


}